let homeState = {
    count: 34,
    userId: 1001,
    userList: [
        {
            key: '1',
            name: '胡彦斌',
            age: 32,
            address: '西湖区湖底公园1号',
        },
        {
            key: '2',
            name: '胡彦祖',
            age: 42,
            address: '西湖区湖底公园1号',
        },
    ]
}

const HomeStateReducer = (state = homeState, action) => {
    switch (action.type) {
        case 'SET_HOME_STATE':
            return {
                ...homeState,
                count: action.payload.acount,
            }
        case 'SET_HOME_USER':
            return {
                ...homeState,
                userList: state.userList.concat(action.payload),
            }
        default:
            return state
    }
}

export default HomeStateReducer;